<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
<%@ include file="/WEB-INF/jsp/public/commons.jspf"%>
<title>商品管理</title>
<script type="text/javascript">
function ajxaddtoStorage(id) {
	$.ajax({
		type : "GET",
		url : "goods_ajxaddtoStorage.do?id="+id,
		dataType:"text",
		success : function(msg) {
			alert(msg);
		}
	});
}
</script>
</head>
<body>
<s:form action="goods_list">
<input type="hidden" name="Searchname" value="${Searchname}"/>
<input type="hidden"  name="GoodsCatename" value="${GoodsCatename}"/>
</s:form> 
	<div id="Title_bar">
		<div id="Title_bar_Head">
			<div id="Title_Head"></div>
			<div id="Title">
				<!--页面标题-->
				<img border="0" width="13" height="13"
					src="${pageContext.request.contextPath}/style/images/title_arrow.gif" />
				商品管理
			</div>
			<div id="Title_End"></div>
		</div>
	</div>
	<!--查询处理-->
	<div id="QueryArea">
		<div style="height: 50px" >
		<%--处理分类查询和模糊查询表单--%>
			<s:form action="goods_list">
				<table >
					<tr>
						<td>商品分类：</td>
					<td>
					<select name="GoodsCatename" class="SelectStyle">
					<option value="0">所有分类</option>	
					<s:iterator value="#request.GoodsCateList" var="Cate">
					<option value="${id}">${name}</option>	
					</s:iterator>
					</select>
					
				    </td>
				    <td>商品名模糊查询：</td>
				     <td>
				     <input type="text" id="GoodsName" name="Searchname" value="${Searchname}"> </input>
				     </td>
				<td><input type="IMAGE" src="${pageContext.request.contextPath}/style/blue/images/button/query.PNG"/></a></td>
					</tr>
				</table>
			</s:form>
		</div>
	</div>

			<!--     商品管理列表          -->
		<div id="MainArea">
		<table cellspacing="0" cellpadding="0" class="TableStyle">
			<!-- 表头-->
			<thead>
				<tr align=center valign=middle id=TableTitle>
					<td width="200">商品名称</td>
					<td>商品分类</td>
					<td>商品价格</td>
					<td>商品描述</td>
					<td>相关操作</td>
				</tr>
			</thead>
			<!--显示数据列表-->
			<tbody id="TableData" class="dataContainer" datakey="userList">
				<s:iterator value="recordList" >
					<tr align="center" valign="middle" class="TableDetail1 template">
						<s:hidden name="id" value=""></s:hidden>
						<td>${name}&nbsp;</td>
						<td>${goodsCate.name}&nbsp;</td>
						<td>${price}&nbsp;</td>
						<td>${desc}&nbsp;</td>
						<td>	
						<s:a action="goods_delGoods?id=%{id}" onclick="javascript:return confirm('确定要删除吗？')">删除</s:a>
								&nbsp;
						<s:a action="goods_editGoodsUI?id=%{id}">修改</s:a>
							&nbsp;
						<button onclick="ajxaddtoStorage('${id}');">添加到库存</button>
						</td>
					</tr>
				</s:iterator>

			</tbody>
		</table>
		<!--新建-->
		<div id="TableTail">
			<div id="TableTail_inside">
				<s:a action="goods_saveGoodsUI">
					<img
						src="${pageContext.request.contextPath}/style/images/createNew.png" />
				</s:a>
			</div>
		</div>
	</div>
   
	 <!-- 分页信息 -->
	<%@ include  file="/WEB-INF/jsp/public/pageView.jspf"%>
</body>
</html>
